Nasa has a nice set on meteorite landings. See the source of the data here.
library(dplyr)
library(readr)
library(leaflet)
library(ggplot2)
library(knitr)
library(plotly)
The data is a plain csv file. We create a proper date column, rename mass (g) and create a mass in kilograms.
meteorites <- read_csv(
"Meteorite_Landings.csv",
col_types = cols(year = col_character())
) %>%
rename (mass = `mass (g)` ) %>%
mutate(
mass_kg = mass / 1000,
date = as.POSIXct(year,format="%d/%m/%Y %H:%M:%OS"),
recency = 2020 - lubridate::year(date)
)
kable(head(meteorites, 7))
| name | id | nametype | recclass | mass | fall | year | reclat | reclong | GeoLocation | mass_kg | date | recency |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Aachen | 1 | Valid | L5 | 21 | Fell | 01/01/1880 12:00:00 AM | 50.77500 | 6.08333 | (50.775, 6.08333) | 0.021 | 1880-01-01 12:00:00 | 140 |
| Aarhus | 2 | Valid | H6 | 720 | Fell | 01/01/1951 12:00:00 AM | 56.18333 | 10.23333 | (56.18333, 10.23333) | 0.720 | 1951-01-01 12:00:00 | 69 |
| Abee | 6 | Valid | EH4 | 107000 | Fell | 01/01/1952 12:00:00 AM | 54.21667 | -113.00000 | (54.21667, -113.0) | 107.000 | 1952-01-01 12:00:00 | 68 |
| Acapulco | 10 | Valid | Acapulcoite | 1914 | Fell | 01/01/1976 12:00:00 AM | 16.88333 | -99.90000 | (16.88333, -99.9) | 1.914 | 1976-01-01 12:00:00 | 44 |
| Achiras | 370 | Valid | L6 | 780 | Fell | 01/01/1902 12:00:00 AM | -33.16667 | -64.95000 | (-33.16667, -64.95) | 0.780 | 1902-01-01 12:00:00 | 118 |
| Adhi Kot | 379 | Valid | EH4 | 4239 | Fell | 01/01/1919 12:00:00 AM | 32.10000 | 71.80000 | (32.1, 71.8) | 4.239 | 1919-01-01 12:00:00 | 101 |
| Adzhi-Bogdo (stone) | 390 | Valid | LL3-6 | 910 | Fell | 01/01/1949 12:00:00 AM | 44.83333 | 95.16667 | (44.83333, 95.16667) | 0.910 | 1949-01-01 12:00:00 | 71 |
The mass of the meteorite is recorded. Below you see a histogram of the mass_kg (log 10 scale). so log_mass_kg = 0 means the meteorite had a mass of 1 KG.
meteorites = meteorites %>%
filter( recency >= 0) %>%
mutate(
log_mass_kg = log10(mass_kg)
)
ggplot(meteorites, aes(x=log_mass_kg)) + geom_histogram(col = "black")
The following plots shows the mass of the meteorite versus date of landing
meteorites %>% ggplot(aes(x = date, y = mass_kg)) + geom_line()
meteorites %>% ggplot(aes(x = date, y = log_mass_kg)) + geom_line()
For most, not all, the date of the landing is recorded. The following histogram shows how recent the landing was (in years).
meteorites = meteorites %>%
filter( recency >= 0, recency < 200)
ggplot(meteorites, aes(x=recency)) + geom_histogram(col = "black", binwidth = 5)
mclasses = meteorites %>%
group_by(recclass) %>%
summarise(n=n()) %>%
arrange(desc(n)) %>%
head(30)
# ggplot(aes(recclass, weight = n)) +
# geom_bar()
plot_ly(mclasses, x=~recclass, y = ~n )
## No trace type specified:
## Based on info supplied, a 'bar' trace seems appropriate.
## Read more about this trace type -> https://plot.ly/r/reference/#bar
Interactive map of astroid locations.
reds <- colorNumeric("Reds", domain = NULL)
labels = paste(sep = "<br>", meteorites$name, lubridate::year(meteorites$date))
leaflet(
data = meteorites,
width = "1400px", height = "1100px",
) %>%
addTiles() %>%
setView(5,50, zoom = 5) %>%
addCircleMarkers(
~reclong, ~reclat,
label = ~labels,
radius = ~log_mass_kg,stroke = TRUE, weight = 2,
fillOpacity = .75,
color = ~reds(recency)
) %>%
addLegend(
pal = reds,
values = ~recency,
group = "circles", position = "bottomleft", title = "recency (in years)"
)